package org.swim.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.SequenceGenerator;
import javax.persistence.GeneratedValue;

@Entity
@Table(name="richiestaAggiuntaAbilita")
@SequenceGenerator(name="ABILITYREQUEST_SEQUENCE", sequenceName="AR_SEQ", allocationSize = 1, initialValue=1)
public class AddAbilityRequest implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="idRichiestaAggiuntaAbilita")
	@GeneratedValue(strategy=GenerationType.AUTO, generator="ABILITYREQUEST_SEQUENCE")
	private int idRichiesta;
	
	@ManyToOne
	@JoinColumn(name="approvatore", referencedColumnName="idUtente")
	private User approvatore;
	
	@ManyToOne
	@JoinColumn(name="mittente", referencedColumnName="idUtente")
	private User mittente;
	
	@OneToOne
	@JoinColumn(name="abilita", referencedColumnName="idAbilita")
	private Ability ability;
	
	@Column(name="approvata")	
	private boolean approvata;
	
	public int getIdRichiesta() {
		return idRichiesta;
	}
	public void setIdRichiesta(int idRichiesta) {
		this.idRichiesta = idRichiesta;
	}
	
	public User getApprovatore() {
		return approvatore;
	}
	public void setApprovatore(User approvatore) {
		this.approvatore = approvatore;
	}

	public User getMittente() {
		return mittente;
	}
	public void setMittente(User mittente) {
		this.mittente = mittente;
	}

	public Ability getAbilita() {
		return ability;
	}
	public void setAbilita(Ability ability) {
		this.ability = ability;
	}

	public boolean isApprovata() {
		return approvata;
	}
	public void setApprovata(boolean approvata) {
		this.approvata = approvata;
	}
}
